package cn.ac.siom.query.service.impl;

import cn.ac.siom.query.dao.IMediaDao;
import cn.ac.siom.query.service.IMediaService;
import cn.ac.siom.query.vo.Media;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.sql.SQLException;
import java.util.List;

@Service
public class MediaServiceImpl implements IMediaService {


    @Resource
    private IMediaDao mediaDao;


    @Override
    public List<Media> list_page(Integer type,Integer rownum, Integer page_id) throws SQLException {
        return this.mediaDao.find_page(type,rownum,page_id);
    }

    @Override
    public Integer list_count(Integer type) throws SQLException {
        return this.mediaDao.find_count(type);
    }

    @Override
    public Integer list_countAll() throws SQLException {
        return this.mediaDao.find_countAll();
    }

    @Override
    public boolean insert(Media vo) throws SQLException {
        return this.mediaDao.insert(vo);
    }

    @Override
    public List list_photo() throws SQLException {
        return this.mediaDao.find_photo();
    }

    @Override
    public boolean update(Media vo) throws SQLException {
        return  this.mediaDao.update(vo);
    }

    @Override
    public boolean delete(List<String> ids) throws SQLException {
        return  this.mediaDao.delete(ids);
    }

    @Override
    public Media list_one(Integer id) throws SQLException {
        return this.mediaDao.find_one(id);
    }

    @Override
    public List<Media> list_pageAll(Integer rownum, Integer page_id) throws SQLException {
        return this.mediaDao.find_pageAll(rownum,page_id);
    }
}
